project(zhilaiSDK VERSION ${GLOBAL_VERSION})

# 添加版本信息
include(${SRC_DIR}/cmake/version.cmake)

add_definitions(
    -DZLDEVICE_EXPORT
)

# set include path
include_directories(
    ${SRC_DIR}
    ${SRC_DIR}/common
    ${SRC_DIR}/common/include
    ${SRC_DIR}/common/third_party
)

if (MSVC)
    set(LIB_ZLBASE ${SRC_DIR}/common/zlbase_v2.0.7_msvc2015)
endif ()

include_directories(
    ${LIB_ZLBASE}/include
    rapidjson-1.1.0/include
)

link_directories(
    ${LIB_ZLBASE}/lib
)

set(SRC_HEADERS
    "${SRC_DIR}/common/util/config.h"
    "zhilaiSDK.h"
    "ZLDoorControlBoard.h"
    "ZLMonitorControlBoard.h"
    "CDeviceManager.h"
    "CMultipleDatalink.h"
)

set(SRC_SOURCES
    "${SRC_DIR}/common/util/config.cpp"
    "zhilaiSDK.cpp"
    "ZLDoorControlBoard.cpp"
    "ZLMonitorControlBoard.cpp"
    "CDeviceManager.cpp"
)

add_library(${PROJECT_NAME} SHARED 
    ${VERSIONINFO_RC} 
    ${SRC_HEADERS} 
    ${SRC_SOURCES}
)
target_link_libraries(${PROJECT_NAME} zlbase)